<template>
  <div>子组件
    <button @click="update">修改父组件的值</button>
  </div>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      required: true
    }
  },
  methods: {
    update() {
      this.$emit('update:visible', !this.visible)
    }
  }
}
</script>
